﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Assets.Core
{
    public static class UtilsManager
    {
        public static bool CheckIndexOfArray(Array _array, params int[] _indices)
        {
            if (_array.Rank != _indices.Length)
                throw new Exception("array dimensions doesnt match with the indices amount");

            for (int dimension = 0; dimension < _array.Rank; dimension++)
            {
                if (_indices[dimension] < 0 || _indices[dimension] >= _array.GetLength(dimension))
                    return false;
            }

            return true;
        }
    }
}
